﻿using HBase;
using hCommand;
using Net.http;
using Persistence; 
using System;
using System.Collections.Generic;
 

namespace WebApi {

    [RoutePrefix("api/welcome")]
    public class WelcomeController :BaseApiController {
        IItemServer itemServer = WMSDalFactray.getDal<IItemServer>(); 
        ICSDServer csdServer = WMSDalFactray.getDal<ICSDServer>();
        [HttpGet, Route("data")]
        public BaseResult data() {
 


            return new BaseResult(null);

        }


        [HttpPost, Route("indexData")]
        public BaseResult indexData([FromBody] PageDto dto) {
            if(dto == null) {
                return BaseResult.Ok("");
            }
            String name = CookieHelper.LoginName();
            Page<CoreItem> p = itemServer.getIndexItemPage(dto);
        


            return BaseResult.Ok(p);
        }
        [HttpGet, Route("lastData")]
        public BaseResult lastData() {
            List<CoreStockDet> list = csdServer.lastCoreStockDetail( );
            

            return BaseResult.Ok(list);
        }

    }

    public class Pages<T> {
        /**
		 * 记录总数
		 */
        public long totalSize { get; set; }

        /**
		 * 分页数据
		 */
        public List<T> content { get; set; }
    }
}
